/**
 * 快速创建一个js的codemirror
 * @param code {string}
 * @returns {{cmOptions: {mode: string, lineNumbers: boolean, tabSize: number, line: boolean, theme: string, readOnly: boolean}, code: string}}
 */
export function quickJsCode(code = '') {
    return {
        code,
        cmOptions: {
            tabSize: 4,
            mode: 'text/javascript',
            theme: 'material',
            lineNumbers: true,
            line: true,
            readOnly: true
            // more CodeMirror options...
        }
    }
}

/**
 * 快速创建一个html的codemirror
 * @param code {string}
 * @returns {{cmOptions: {mode: string, lineNumbers: boolean, tabSize: number, line: boolean, theme: string, readOnly: boolean}, code: string}}
 */
export function quickHtmlCode(code = '') {
    return {
        code,
        cmOptions: {
            tabSize: 4,
            mode: 'text/html',
            theme: 'material',
            lineNumbers: true,
            line: true,
            readOnly: true
            // more CodeMirror options...
        }
    }
}

/**
 * 快速创建一个bash的codemirror
 * @param code {string}
 * @returns {{cmOptions: {mode: string, lineNumbers: boolean, tabSize: number, line: boolean, theme: string, readOnly: boolean}, code: string}}
 */
export function quickBashCode(code = '') {
    return {
        code,
        cmOptions: {
            tabSize: 4,
            mode: 'bash',
            theme: 'material',
            lineNumbers: true,
            line: true,
            readOnly: true
            // more CodeMirror options...
        }
    }
}

/**
 * 快速创建一个js的codemirror
 * @param code {string}
 * @returns {{cmOptions: {mode: string, lineNumbers: boolean, tabSize: number, line: boolean, theme: string, readOnly: boolean}, code: string}}
 */
export function quickScssCode(code = '') {
    return {
        code,
        cmOptions: {
            tabSize: 4,
            mode: 'text/x-scss',
            theme: 'material',
            lineNumbers: true,
            line: true,
            readOnly: true
            // more CodeMirror options...
        }
    }
}
